import requests
from api.login import LoginApi

from config import BASE_URL


def get_headers(mobile="13800000002", password="123456"):
    url = BASE_URL + '/api/sys/login'
    body = {
        "mobile": mobile,
        "password": password
    }
    resp = LoginApi.login(body)
    # 拼接token
    token = "Bearer " + resp.json().get("data")
    headers = {
        'Content-Type': 'application/json',
        'Authorization': token
    }
    return headers